set saveErrorLevel=%errorlevel%

set msiLogShare=\\SYSSCCMDB2-S5.mid.dom\DWFmsiLogs
reg query HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters /v domain|find "mid.dom" 
if %errorlevel% EQU 0 goto DoCopy

reg query HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters /v domain|find "sys.dom" 
if %errorlevel% EQU 0 goto DoCopy

set msiLogShare=\\SYSSCCMDB3-S5.dmz.dom\DWFmsiLogs
reg query HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters /v domain|find "dmz.dom" 
if %errorlevel% EQU 0 goto DoCopy

set msiLogShare=\\fileShare.tst2.dom\DWFmsiLogs
reg query HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters /v domain|find "tst2.dom" 
if %errorlevel% EQU 0 goto DoCopy

exit /B %saveErrorLevel%

:DoCopy
rem copy command does not make directory
mkdir "%msiLogShare%\%ComputerName%"
if exist "%msiLogShare%\%ComputerName%\%1" (copy /Y %1 "%msiLogShare%\%ComputerName%\%1.newest.log") else (copy /Y %1 "%msiLogShare%\%ComputerName%\")

set msiLofgFile=%1
set DexCheckLogFile=%msiLofgFile:install=DexCheck%
copy /Y %DexCheckLogFile% "%msiLogShare%\%ComputerName%\"
exit /B %saveErrorLevel%